First, prefaceSince innertext is not a standard property, we cannot use it in Firefox, and we can generally use textcontent instead, but can it be exactly the same? Is it still weird in the form elements of the pit daddy (such as input, textarea,
First, prefaceSince innertext is not a standard property, we cannot use it in Firefox, and we can generally use textcontent instead, but can it be exactly the same? Is it still weird in the form elements of the pit daddy (such as input, textarea,
Differences between textContent and innerTextIE has an innerText attribute, and FF has a textContent attribute. Many of the scripts previously written to IE cannot find the innerText attribute under FF. Therefore, we recommend that you use
The difference between textcontent and innertext
There is a innertext property under IE, FF has a textcontent attribute. Many of the former to write to IE script, in the FF can not find the innertext attribute, so the internet found the suggestion
InnerHTMLouterHTML; innerTextouterText; textContent-GentleMint innerHTML v. s. outerHTML
Element. innerHTML
Reference: https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML
Functionality
Get serialized HTML code
The innerHTML property is used to read or set the HTML code within a node.When the outerHTML property is used to read or set HTML code, the node itself is included.The Textcontent property is used to read or set the text content that the node
This article mainly introduces the innerHTML attribute, outerHTML attribute, textContent attribute, and innerText attribute differences in javascript. it is a summary of my personal experience and I hope you will like it. The innerHTML attribute is
This article mainly introduced the JavaScript innerHTML attribute, outerhtml attribute, textcontent attribute, innertext attribute difference detailed explanation, all is the personal experience summary, shares to everybody, hoped everybody can like.
The innerHTML property is used to read or set the HTML code within a node.
When the outerHTML property is used to read or set the HTML code, the node itself is included.
The Textcontent property is used to read or set the text content that the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.